#include "systemsettingsdialog.h"
#include "ui_systemsettingsdialog.h"
#include "wagemanagementdialog.h"
#include "deletemonthdatadialog.h"
#include <QMessageBox>

SystemSettingsDialog::SystemSettingsDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::SystemSettingsDialog)
{
    ui->setupUi(this);
    
    // 创建设置对象
    settings = new QSettings("ToyFactory", "OA", this);
    
    // 连接信号和槽
    connect(ui->closeButton, &QPushButton::clicked, this, &SystemSettingsDialog::onClose);
    
    // 连接工价管理按钮
    connect(ui->wageManagementButton, &QPushButton::clicked, this, &SystemSettingsDialog::onWageManagement);
    
    // 连接删除月数据按钮
    connect(ui->deleteMonthDataButton, &QPushButton::clicked, this, &SystemSettingsDialog::onDeleteMonthData);
}

SystemSettingsDialog::~SystemSettingsDialog()
{
    delete ui;
}

void SystemSettingsDialog::onClose()
{
    this->close();
}

// 工价管理按钮槽函数实现
void SystemSettingsDialog::onWageManagement()
{
    WageManagementDialog dialog(this);
    dialog.exec();
}

// 删除月数据按钮槽函数实现
void SystemSettingsDialog::onDeleteMonthData()
{
    DeleteMonthDataDialog dialog(this);
    dialog.exec();
}